import { createRouter, createWebHistory } from "vue-router";
import PageIndex from "../views/index.vue";
export const routes = [
  {
    path: "/",
    component: PageIndex,
    redirect: "/login",
    children: [
      {
        path: "/home",
        name: "Home",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Home"),
      },
      {
        path: "/list",
        name: "List",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/List"),
      },
      {
        path: "/editor",
        name: "Editor",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Editor"),
      },
      {
        path: "/classify",
        name: "Classify",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Classify"),
      },
      {
        path: "/label",
        name: "Label",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Label"),
      },
      {
        path: "/pagerou",
        name: "PageRou",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/PageRou"),
      },
      {
        path: "/knowledge",
        name: "Knowledge",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Knowledge"),
      },
      {
        path: "/poster",
        name: "Poster",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Poster"),
      },
      {
        path: "/comment",
        name: "Comment",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Comment"),
      },
      {
        path: "/mailbox",
        name: "Mailbox",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Mailbox"),
      },
      {
        path: "/file",
        name: "File",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/File"),
      },
      {
        path: "/search",
        name: "Search",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Search"),
      },
      {
        path: "/visit",
        name: "Visit",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/Visit"),
      },
      {
        path: "/user",
        name: "User",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/User"),
      },
      {
        path: "/system",
        name: "System",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/System"),
      },
      {
        path: "/uoPass",
        name: "UoPass",
        meta: {
          author: ["USER", "TC"],
        },
        component: () => import("../views/UoPass/index.vue"),
      },
    ],
  },
  {
    path: "/register",
    name: "Register",
    component: () => import("../views/Register/index.vue"),
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login/index.vue"),
  },{
    path:"/save/:id",
    name:"Save",
    meta: {
      author: ["USER", "TC"],
    },
    component: () => import("../views/Save/index.vue"),
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
